package Wix::Tag::Component;

use parent qw/Wix::Tag/;

use Wix::Tag::ComponentRef;

sub new() {
	my ($class, $args) = @_;
	
	my $self = Wix::Tag->new({TAG => 'Component'});
	
	$self->addAttr('Id', $args->{ID});
	$self->addGUID('Guid');
	
	return bless($self, $class);
}

sub getComponentRef() {
	my ($self) = @_;
	
	return Wix::Tag::ComponentRef->new(
		{
			ID => $self->getElement()->attr('Id')
		}
	);
}

sub addDirectory($) {
	my ($self, $directory) = @_;

	$self->addElement('Wix::Tag::Directory', $directory);	
}

sub addFile($) {
	my ($self, $file) = @_;

	$self->addElement('Wix::Tag::File', $file);	
}

sub addComponent($) {
	my ($self, $component) = @_;

	$self->addElement('Wix::Tag::Component', $component);	
}

sub addRegistryKey($) {
	my ($self, $registrykey) = @_;

	$self->addElement('Wix::Tag::RegistryKey', $registrykey);	
} 

sub addShortcut($) {
	my ($self, $shortcut) = @_;
	
	$self->addElement('Wix::Tag::Shortcut', $shortcut);
}

sub addRemoveFolder($) {
	my ($self, $removefolder) = @_;
	
	$self->addElement('Wix::Tag::RemoveFolder', $removefolder);
}

1;